<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.db.conn"%>
<%@ page import="java.sql.*"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<script src="<%=path %>/admin/js/jquery.js" type="text/javascript"></script>
<script src="<%=path %>/admin/js/formValidator.js" type="text/javascript"></script>  
<script src="<%=path %>/admin/js/formValidatorRegex.js" type="text/javascript"></script>
<link href="<%=path %>/admin/css/validator.css" rel="stylesheet" type="text/css" />



<jsp:include flush="true" page="${basePath}/admin/head.jsp"></jsp:include>
 <div class="panel panel-primary">
            <div class="panel-heading">
                <h3 class="panel-title">编辑房间信息</h3>
            </div>
            <div class="panel-body" style="min-height: 500px;">
           <table style="width:100%;"><tr><td align="center">

           		<form action="<%=path %>/rooms_Edit" method="post">

					  <table  style="width:98%;margin-left:10px;" align="center">
                    <tbody>
                        <% 			conn cn=new conn();
    
     			String id = request.getParameter("id");
				String sql = "select * from rooms where rno='" + id +"' ";
				ResultSet rs = cn.query(sql);
				rs.next();
			%>
<tr>
<td  style=" text-align:right; width:20%;"><font style='color:red'>*&nbsp;</font>房间编号:</td>
<td class="tbright"><div style="display:inline;float:left;">
<input name="txt_rno" type="text" id="txt_rno" style="width: 200px; "  value='<%= rs.getString("rno") %>' /></div><div id="txt_rnoTip" style="width:250px;display:inline;float:left;text-align:left;"></div>
 </td></tr>



<tr>
<td  style=" text-align:right; width:20%;"><font style='color:red'>*&nbsp;</font>楼层:</td>
<td class="tbright"><div style="display:inline;float:left;">
<input name="txt_floor" type="text" id="txt_floor" style="width: 200px; "  value='<%= rs.getString("floor") %>' /></div><div id="txt_floorTip" style="width:250px;display:inline;float:left;text-align:left;"></div>
 </td></tr>

<tr>
<td  style=" text-align:right; width:20%;"><font style='color:red'>*&nbsp;</font>朝向:</td>
<td class="tbright"><div style="display:inline;float:left;">
<input name="txt_directions" type="text" id="txt_directions" style="width: 200px; "  value='<%= rs.getString("directions") %>' /></div><div id="txt_directionsTip" style="width:250px;display:inline;float:left;text-align:left;"></div>
 </td></tr>



    <tr>
        <td>&nbsp;</td>
        <td align="left">  
		<input name="id" type="hidden" id="id" value='<%= request.getParameter("id") %>'>
            <input name="tid" type="hidden" value='<%= rs.getString("tid") %>'>
            <input type="submit" name="btnAdd" value="编 辑" onclick="return jQuery.formValidator.PageIsValid('1');" id="btnAdd"  class="btn btn-info" />
    <input name="btnReturn" type="button" value="返 回" class="btn btn-info"  onclick="history.go(-1)"  />
    
               </td>
    </tr>
                    </tbody>
                </table>
				<%
				if (rs != null)
					rs.close();
				if (cn != null)
					cn.close();
			%>
    </form>
	<script language="javascript" type="text/javascript">
    $(document).ready(function() {
        $.formValidator.initConfig({ onError: function(msg) { alert(msg) } });
        $("#txt_rno").formValidator({ onshow: "请输入房间编号", onfocus: "房间编号不能为空", oncorrect: "合法" }).InputValidator({ min: 1, onerror: "房间编号不能为空,请确认" });

        $("#txt_floor").formValidator({ onshow: "请输入楼层", onfocus: "楼层不能为空", oncorrect: "合法" }).InputValidator({ min: 1, onerror: "楼层不能为空,请确认" });
        $("#txt_directions").formValidator({ onshow: "请输入朝向", onfocus: "朝向不能为空", oncorrect: "合法" }).InputValidator({ min: 1, onerror: "朝向不能为空,请确认" });
    });
</script>


   </td></tr></table>
            

            </div>
        </div>







